#include <stdio.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
    // 创建管道文件
    int pipefd[2] = {0};
    int n = pipe(pipefd);
    if(n < 0)
    {
        perror("pipe");
        return 1;
    }

    // 创建子进程
    pid_t id = fork();
    if(id == 0)
    {
        // child w
        close(pipefd[0]);
        exit(0);
    }
    // father r
    close(pipefd[1]);
    pid_t rid = waitpid(id,NULL,0);
    (void)rid;
    


    return 0;
}